<?php

require __DIR__.'/../../../vendor/autoload.php';

use Gateway\app\faceId\GetVerifyTokenRequest;
use Gateway\ESGateway;
use Gateway\JSONUtil;
use Gateway\Log;

$appCode = "d2808c1338ce01f3e3efdb486f9effb9";
$algo = "3";
$key = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhdQdw6uTGz+X4e+/eGpu4dcKrfrjQAe0tTQyn6TuKBobcsUsESkx9jcCeG4cpuxmN8jNeDAZsbTujNLD/aYl2g==";
$esGateway = new ESGateway($appCode, $algo, $key);

$getVerifyTokenRequest = new GetVerifyTokenRequest();
$getVerifyTokenRequest->bizNo = "117577928278938";
$getVerifyTokenRequest->notifyUrl = "https://www.es.com/api/realNameAuthReturn";
$getVerifyTokenRequest->ocrIncIdBack = "true";
$getVerifyTokenRequest->ocrOnly = "true";
$getVerifyTokenRequest->pageBgColor = "#eeeeee";
$getVerifyTokenRequest->retIdImg = "true";
$getVerifyTokenRequest->returnImg = "false";
$getVerifyTokenRequest->returnLiveVideo = "true";
$getVerifyTokenRequest->returnUrl = "https://www.es.com/api/realNameAuthNotice";
$getVerifyTokenRequest->txtBgColor = "#eeeeee";

$gatewayResponse = $esGateway->sendToGateWay(GetVerifyTokenRequest::$act,$getVerifyTokenRequest->toJsonStr());
Log::DEBUG("服务器返回数据：".$gatewayResponse->toJsonStr());
if ($gatewayResponse->bizContent != null) {
    Log::DEBUG("业务数据为：".$gatewayResponse->bizContent);
    $rsp = JSONUtil::fromJsonStr($gatewayResponse->bizContent);
}


